package com.hfzy.ihk.facade.linkcall.entity.task;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hfzy.ihk.common.facade.BaseEntity;
import com.hfzy.ihk.facade.linkcall.enums.CallTaskStatus;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * Created by Administrator on 2018/7/19.
 *
 * 呼叫任务
 * @author wws
 */
@Document(indexName = "#{elasticSearchConfig.indexName()}_call_task",shards = 24,replicas = 2, type = "data")
public class CallTask implements BaseEntity {

    @Id
    @Field(type = FieldType.Keyword)
    private String id;

    private long version;

    @Field(type = FieldType.Keyword)
    private String taskName;//任务名称

    @Field(type = FieldType.Keyword)
    private String projectName;//指定的项目名

    private  int callNum; //任务量

    private int calledNum;//已call量 --- 通过接口获取？

    private int  takePhoneNum;//已获取号码的次数

    private long createUserId;

    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss" )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 话术包//提醒话术id
     * */
    private String packageId;

    @Field(type = FieldType.Keyword)
    private CallTaskStatus status = CallTaskStatus.CALLING;//状态 --- 默认是进行中

    @Override
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public long getVersion() {
        return version;
    }

    public void setVersion(long version) {
        this.version = version;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public long getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(long createUserId) {
        this.createUserId = createUserId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getPackageId() {
        return packageId;
    }

    public void setPackageId(String packageId) {
        this.packageId = packageId;
    }

    public CallTaskStatus getStatus() {
        return status;
    }

    public void setStatus(CallTaskStatus status) {
        this.status = status;
    }

    public int getCallNum() {
        return callNum;
    }

    public void setCallNum(int callNum) {
        this.callNum = callNum;
    }

    public int getCalledNum() {
        return calledNum;
    }

    public void setCalledNum(int calledNum) {
        this.calledNum = calledNum;
    }

    public int getTakePhoneNum() {
        return takePhoneNum;
    }

    public void setTakePhoneNum(int takePhoneNum) {
        this.takePhoneNum = takePhoneNum;
    }
}
